<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            list-style: none;
        }

        header {
            width: 100%;
            height: 60px;
            line-height: 60px;
            background-color: rgb(24, 114, 170);
        }

        .one {
            float: right;
            margin-right: 10px;

        }

        .zcont {
            display: flex
        }

        aside {
            width: 200px;
            height: 800px;
            background-color: rgb(18, 18, 94);
        }


        aside ul li {
            width: 180px;
            height: 60px;
            color: #eee;
            line-height: 60px;
            margin-left: 20px;

        }

        p {
            width: 1490px;
            height: 40px;
            background-color: antiquewhite;
            line-height: 40px;

        }

        p span {
            width: 80px;
            height: 40px;
            margin-left: 10px;
        }

        .two {
            width: 80px;
            height: 40px;
            padding: 10px;
            background-color: black;
            color: azure;
        }

        .three {
            float: right;

        }

        .a1 {
            width: 100%;
            height: 100px;
            background-color: bisque;
            display: flex;
            justify-content: space-around;
        }

        .sex {
            width: 20%;
            height: 100px;
            background-color: rgb(24, 114, 170);
            margin-left: 10px;
            padding: 0 10px;
        }

        .sex:nth-child(3) {
            background-color: rgb(64, 224, 144);
        }

        .sex:nth-child(4) {
            background-color: rgb(111, 119, 115);
        }

        .sex span {
            line-height: 60px;
            font-size: 25px;
        }

        .b {
            width: 100%;
            height: 500px;

            display: flex;
            justify-content: space-around;
        }

        .b1 {
            width: 48%;
            height: 480px;

            margin-top: 20px;
            box-shadow: 2px 2px 3px #888888;
        }

        main table {
            margin: 20px 0;
            width: 98%;
            line-height: 40px;
            text-align: center;
            border: 1px solid #888888;
            margin-top: 20px;
            margin-left: 15px;

        }

        main table tr th {
            max-width: 100px;

        }

        main table tr th:first-child,
        main table tr td:first-child {
            text-align: left;
        }
    </style>

</head>

<body>

    <header>
        <span>后台管理</span>
        <span></span>
        <span class="one">角色：管理员</span> <span class="one">当前用户:bootstrap</span>
    </header>
    <section class="zcont">
        <aside>
            <ul>
                <li>后台首页</li>
                <li>设计元素</li>
                <li>表单元素</li>
                <li>示例页面</li>
                <li>常用列表</li>
                <li>脚本插件</li>
                <li>统计图表</li>
            </ul>
        </aside>
        <main>
            <p>
                <span>箭头</span>
                <span class="two">欢迎首页</span>
                <span class="three">页签操作</span>
                <span class="three">箭头</span>
            </p>

            <div class="a1">
                <div class="sex">
                    <h4>今日收入</h4>
                    <span>100,000.00</span><span class="fixe"></span>
                </div>

                <div class="sex">
                    <h4>昨日收入</h4>
                    <span>200,000.00</span><span class="fixe"></span>
                </div>

                <div class="sex">
                    <h4>月累计收入</h4>
                    <span>1000,000.00</span><span class="fixe"></span>
                </div>

                <div class="sex">
                    <h4>年累计收入</h4>
                    <span>5000,000.00</span><span class="fixe"></span>
                </div>
            </div>


            <div class="b">
                <div class="b1"></div>
                <div class="b1"></div>
            </div>

            <table>
                <thead>
                    <tr>
                        <th>#</th>
                        <th>订单号</th>
                        <th>商品名称</th>
                        <th>下单日期</th>
                        <th>状态</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>1</td>
                        <td>滑块特效</td>
                        <td>黑色牛仔裤</td>
                        <td>2019-05-01</td>
                        <td>完成</td>

                    </tr>
                    <tr>
                        <td>1</td>
                        <td>滑块特效</td>
                        <td>黑色牛仔裤</td>
                        <td>2019-05-01</td>
                        <td>完成</td>

                    </tr>
                </tbody>
            </table>
        </main>
    </section>


</body>

</html>

<script src="./ajax.promise.js"></script>
<script>
    ajax('get', './data.json', { }).then((res) => {
        reat(res)
    })

function reat(res){
    var str = res.map((item, index) => {
        return ` <tr>
                    <td>${item.id}</td>
                    <td>${item.name}</td>
                    <td>${item.age}</td>
                    <td>${item.sex}</td>
                    <td>${item.hobby}</td>
                   
                </tr> `
    }).join('')
    document.querySelector('tbody').innerHTML = str

}

</script>